package com.foreknow.demo3;

import java.util.Scanner;

/**
 *
 */
public class ArrayDemo4 {
    public static void main(String[] args) {
        int[] num = new int[10];
        Scanner input = new Scanner(System.in);
        for (int a = 0; a < num.length; a++) {
            System.out.println("请输入数据：");
            num[a] = input.nextInt();
        }
        int sum = 0;
        int avg = 0;
        for (int i = 0; i < num.length; i++) {
            sum += num[i];
            avg = sum / 10;
        }
        System.out.println("总和为：" + sum);
        System.out.println("平均值为：" + avg);

    }
}












